#%RAML 1.0 Library
uses:
  constraints: constraint.raml
  label: label.raml
  strings: stringTypes.raml
  pragma: pragma.raml

types:
  Volume:
    type: object
    properties:
      name:
        type: strings.Name
        description: The name of the volume to reference.
      host?:
        type: string
        description: |
          Absolute path of the file or directory on the agent, or else the relative
          path of the directory in the executor's sandbox.
          Host volumes are useful for mapping directories that exist on the agent apriori,
          or within the executor sandbox. No resources (Mesos or otherwise) are allocated for
          these types of volumes.
  VolumeMount:
    type: object
    properties:
      name:
        type: strings.Name
        description: The name of the volume to reference.
      mountPath:
        type: strings.Path
        description: The path inside the container at which the volume is mounted.
      readOnly?:
        type: boolean
  PersistentVolumeType:
    type: string
    description: The type of mesos disk resource to use; defaults to root
    enum: [ root, path, mount ]
  PersistentVolume:
    type: object
    properties:
      type?:
        type: PersistentVolumeType
      size:
        type: integer
        format: int64
        minimum: 0
        description: The size of the persistence volume in MB.
      maxSize?:
        type: integer
        format: int64
        minimum: 0
        description: |
          For `mount` mesos disk resources, the optional maximum size of an exclusive mount volume to be considered.
      constraints?:
        type: constraints.VolumeConstraint[]
        description: |
          Constraints restricting where new persistent volumes should be created.
          Currently, it is only possible to constrain the path of the disk resource by regular expression.
        uniqueItems: true
  ExternalVolume:
    type: object
    properties:
      size?:
        type: integer
        format: int64
        description: The size of the external volume in MB
      name?:
        type: string
        description: The name of the volume
      provider?:
        type: string
        description: The name of the volume provider
      options?:
        type: label.KVLabels
        (pragma.omitEmpty):
        description: Provider specific volume configuration options
  AppVolume:
    type: object
    properties:
      containerPath:
        type: string
        minLength: 1
        description: The path of the volume in the container
      hostPath?:
        type: string
        minLength: 1
        description: The path of the volume on the host
      persistent?: PersistentVolume
      external?: ExternalVolume
      mode:
        type: strings.ReadMode
        description: Possible values are RO for ReadOnly and RW for Read/Write
